import { buildingReq } from "@/request/building-request";
interface Building {
    id:number,
    number:string,
    unit:string,
    remarks:string
}
interface Page {
    currentPage:string,
    pageSize:string
}
export const buildingApi = {
    getAllBuildings() {
        let res = buildingReq.get("/all", {params: {}});
        return res;
    },
    getBuildingsByConditions(currentPage:string,pageSize:string,building:Building) {
        let res = buildingReq.post("/conditions", building, {params:{
            currentPage, pageSize
        }});
        return res;
    },
    addBuilding(building:Building) {
        let res = buildingReq.post('/addbuilding', building);
        return res;
    },
    modifyBuilding(building:Building) {
        let res = buildingReq.put('/modifybuilding',building);
        return res;
    },
    deleteBuilding(ids:string) {
        let res = buildingReq.delete('/deleteBuilding',{params:{ids}});
        return res;
    }
}